package indi.zhang.rocketmq.config;

import indi.zhang.mq.api.Producer;
import indi.zhang.rocketmq.utils.RktMqProducer;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;

public class MqConfig {

    @Bean
    @ConditionalOnProperty(value = "indi.zhang.common.rkt",matchIfMissing = true, havingValue = "true")
    public Producer producer(RocketMQTemplate rocketMQTemplate) {
        return new RktMqProducer(rocketMQTemplate);
    }

}
